/*************************************************************************
	> File Name: State.h
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-22 18:15:45
 ************************************************************************/

#ifndef __STATE_H__
#define __STATE_H__

class State;

class Context
{
public:
    Context(State * pState);
    ~Context();

    void Request();
    void ChangeState(State * pState);

private:
    State * _pState;
};

class State
{
public:
    State(){}
    virtual ~State(){}

    virtual void Handle(Context * pContext) = 0;
};

class ConcreateStateA
:public State
{
public:
    void Handle(Context * pContext);
};

class ConcreateStateB
:public State
{
public:
    void Handle(Context * pContext);
};


#endif
